/*
 *  Copyright (C) 2009  Peter Kist & Jan Ripke
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef __input_oisinput_mouseeventhandler_h
#define __input_oisinput_mouseeventhandler_h 1

#include <boost/weak_ptr.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>

#include <OISMouse.h>

#include <Core/Mediator/Event.h>

namespace galaxy {
    namespace input {

        class MouseEvent;

        namespace ois_input {

            class Manager;

            class MouseEventHandler :
                public OIS::MouseListener
            {
                boost::weak_ptr<Manager>         m_Manager;
                boost::posix_time::ptime         m_Timer;

                MouseEventHandler(void) { }; 

            public:
                MouseEventHandler(boost::shared_ptr<Manager> manager);
                virtual ~MouseEventHandler(void);

                virtual bool mouseMoved(OIS::MouseEvent const &arg);
                virtual bool mousePressed(OIS::MouseEvent const &arg, OIS::MouseButtonID id);
                virtual bool mouseReleased(OIS::MouseEvent const &arg, OIS::MouseButtonID id);

            private:

                /** Posts a keyboard event to the mediator */
                bool postMouseEvent (mediator::Event& event);

            };

        } // namespace ois_input
    } // namespace input
} // namespace galaxy

#endif // __input_oisinput_keyeventhandler_h //

